{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "'test data'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f0 = new EasyForm(\"form0\")\n",
    "f0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f1 = new EasyForm(\"form1\")\n",
    "f1.addTextField(\"field name\")\n",
    "f1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f1['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f1['field name'] = '1text from code1'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f2 = new EasyForm(\"form2\")\n",
    "f2.addTextField(\"field name\", 10)\n",
    "f2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f3 = new EasyForm(\"form3\")\n",
    "f3.addTextArea(\"field name\")\n",
    "f3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f3['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f3['field name'] = '3text from code3'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f4 = new EasyForm(\"form4\")\n",
    "f4.addTextArea(\"field name\", 20, 5)\n",
    "f4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f5 = new EasyForm(\"form5\")\n",
    "f5.addTextArea(\"field name\", '5initial value5')\n",
    "f5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f6 = new EasyForm(\"form6\")\n",
    "f6.addCheckBox(\"field name\")\n",
    "f6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f6['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f6['field name'] = 'false'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f7 = new EasyForm(\"form7\")\n",
    "f7.addCheckBox(\"field name\", Boolean.TRUE)\n",
    "f7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f8 = new EasyForm(\"form8\")\n",
    "f8.addComboBox(\"field name\", [\"one\", \"two\", \"three\"])\n",
    "f8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f8['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f8['field name'] = 'three'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f9 = new EasyForm(\"form9\")\n",
    "f9.addList(\"field name\", [\"one\", \"two\", \"three\"])\n",
    "f9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f9['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f9['field name'] = ['one']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f10 = new EasyForm(\"form10\")\n",
    "f10.addList(\"field name\", [\"one\", \"two\", \"three\"], Boolean.FALSE)\n",
    "f10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f10['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f11 = new EasyForm(\"form11\")\n",
    "f11.addList(\"field name\", [\"one\", \"two\", \"three\", \"four\"], 2)\n",
    "f11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f12 = new EasyForm(\"form12\")\n",
    "f12.addCheckBoxes(\"field name\", [\"one\", \"two\", \"three\", \"four\"])\n",
    "f12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f12['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f12['field name']= ['one']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f13 = new EasyForm(\"form13\")\n",
    "f13.addCheckBoxes(\"field name\", [\"one\", \"two\", \"three\"], EasyForm.HORIZONTAL)\n",
    "f13"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f14 = new EasyForm(\"form14\")\n",
    "f14.addRadioButtons(\"field name\", [\"one\", \"two\", \"three\"])\n",
    "f14"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f14['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f14['field name'] = 'three'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f15 = new EasyForm(\"form15\")\n",
    "f15.addRadioButtons(\"field name\", [\"one\", \"two\", \"three\"], EasyForm.HORIZONTAL)\n",
    "f15"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f16 = new EasyForm(\"form16\")\n",
    "f16.addDatePicker(\"field name\")\n",
    "f16"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f16['field name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f16['field name'] = '20170527'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f17 = new EasyForm(\"form17\")\n",
    "f17.addButton(\"run tag\", \"tag1\")\n",
    "button18 = f17.addButton(\"actionPerformed\")\n",
    "button18.actionPerformed = { f18[\"field4\"] = \"from actionPerformed\"}\n",
    "f17"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f18['field2'] = \"test text\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "tags": [
     "tag1"
    ]
   },
   "outputs": [],
   "source": [
    "f18 = new EasyForm(\"form18\")\n",
    "f18.addTextField(\"field1\").onInit({f18['field1'] = \"from onInit\"})\n",
    "f18.addTextField(\"field2\").onChange({text -> f18['field3'] = text + \" from onChange\"})\n",
    "f18.addTextField(\"field3\")\n",
    "f18.addTextField(\"field4\")\n",
    "f18"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "w = new IntSlider()\n",
    "w.value = 50\n",
    "\n",
    "f19 = new EasyForm('form19')\n",
    "f19.addWidget('slider19', w)\n",
    "f19"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f19['slider19']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Groovy",
   "language": "groovy",
   "name": "groovy"
  },
  "language_info": {
   "codemirror_mode": "groovy",
   "file_extension": ".groovy",
   "mimetype": "",
   "name": "Groovy",
   "nbconverter_exporter": "",
   "version": "2.4.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": false,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": false,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
